package com.zhima.properties;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties("aliyun-bailian")
public class AliyunBaiLianProperties implements InitializingBean {
    private String accessKeyId;
    private String accessKeySecret;
    private String endpoint;
    private String agentKey;
    private String promptId;
    private String appId;

    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String ENDPOINT;
    public static String AGENT_KEY;
    public static String PROMPT_ID;
    public static String APP_ID;

    @Override
    public void afterPropertiesSet() throws Exception {
        ACCESS_KEY_ID = accessKeyId;
        ACCESS_KEY_SECRET = accessKeySecret;
        ENDPOINT = endpoint;
        AGENT_KEY = agentKey;
        PROMPT_ID = promptId;
        APP_ID = appId;
    }
}
